﻿Return
0015BC5B-6A69-49B3-A02F-63A6FBFCD6D1:
;&2  重命名 2个文件交换文件名
MySel:=QZData("files")
ArrayCount=0
MyParentPath:=
loop,Parse,MySel,`n     ;循环读取每一行
{
	if A_index=1
		SplitPath,A_loopfield,,MyParentPath
	ArrayCount += 1  ;记录在数组中有多少个项目。
	Array%ArrayCount% := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if ArrayCount=2
		break
}
if (ArrayCount!=2)
	return
SplitPath ,Array1,,,MyExt1,MyNameNoExt1
SplitPath ,Array2,,,MyExt2,MyNameNoExt2
MyTem=%MyParentPath%\Tem.%MyExt1%
MyNew1=%MyParentPath%\%MyNameNoExt2%.%MyExt1%
MyNew2=%MyParentPath%\%MyNameNoExt1%.%MyExt2%
FileMove,%Array1%,%MyTem%
FileMove,%Array2%,%MyNew2%
FileMove,%MyTem%,%MyNew1%
Return
0202F449-28AA-4372-BE69-85CBC3508671:
;通用_删除（Del）
    SendInput,{del}
Return
063C0930-FC6B-4C3D-A8F8-019E91CF63C5:
;&T  正则表达式替换

Return
067F12EE-DA94-42FF-9B37-360C129420C5:
;&2 文档前加✘
CurDate=✘
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
06DF0BA4-3BEF-4DF1-A054-737E1CB3B732:
;&T  重命名 替换文件名中指定内容(Shift:编辑 Ctrl:临时)
ReplaceList=%A_ScriptDir%\User\替换列表.txt
IfNotExist,%ReplaceList%
	return

MyKeyStatus:=
if GetKeyState("Ctrl")
	MyKeyStatus.="Ctrl"
if GetKeyState("Shift")
	MyKeyStatus.="Shift"
if GetKeyState("Alt")
	MyKeyStatus.="Alt"
if GetKeyState("Win")
	MyKeyStatus.="Win"
if GetKeyState("CapsLock", "T")
	MyKeyStatus.="Caps"
;~ msgbox , % MyKeyStatus

if (instr(MyKeyStatus,"Shift")>0) ;按下Shift选择菜单，则编辑替换列表
{
	Run,%ReplaceList%
	return
}
MyArray_List:={}
if (instr(MyKeyStatus,"Ctrl")>0)   ;按下Ctrl选择菜单，则临时替换
{
	InputBox, MyInput, `n提示,请输入替换及替换内容，格式：xxx`=yyy`n`n如果格式为 xxx`=yyy`|x，则添加到替换列表，x可以为任意字符
	StringSplit,MyArray_List,MyInput,`|
	if MyArray_List2!=   ;如果格式为 xxx`=yyy`|x，则添加到替换列表
		FileAppend,`n%MyArray_List1%`n,%ReplaceList%
}
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,,MyOutDir,MyOutExt,MyOutNameNoExt
	MyNewFile=%MyOutDir%\%MyOutNameNoExt%
	;If InStr(FileExist(MyTemFile), "D")
	;    continue
	if MyArray_List1!=   ;如果是临时替换
	{
		MyOldStr:=RegExReplace(MyArray_List1,"=.*?$")  	 ;要替换的字符串
		MyNewStr:=RegExReplace(MyArray_List1,"^.*?=") 	;替换为的字符串
		StringReplace,MyNewFile,MyNewFile,%MyOldStr%,%MyNewStr%,all
	} else {
		loop,Read,%ReplaceList%,`n
		{
			if Trim(A_LoopReadLine)=""
				continue
			MyOldStr:=RegExReplace(A_LoopReadLine,"=.*?$")  	 ;要替换的字符串
			MyNewStr:=RegExReplace(A_LoopReadLine,"^.*?=") 	;替换为的字符串
			StringReplace,MyNewFile,MyNewFile,%MyOldStr%,%MyNewStr%,all
		}
	}
	if MyTemFile=%MyNewFile%.%MyOutExt%
		continue
	MyNewFileCount=%MyNewFile%.%MyOutExt%
	if MyNewFileCount=
		return
	loop
	{
		IfNotExist,%MyNewFileCount%
			break
		MyNewFileCount=%MyNewFile%-%A_Index%.%MyOutExt%
	}
	if InStr(FileExist(MyTemFile), "D")
		FileMoveDir,%MyTemFile%,%MyNewFileCount%
	else
		FileMove,%MyTemFile%,%MyNewFileCount%
}
Return
0A2CEEA3-BCF5-49DE-9FF1-79255E40F89D:
;通用_关闭（Alt+F4）
send,!{f4}
Return
0F157F1F-7C8D-40EC-8917-B5F3850312EE:
;通用_Home
sendinput,{Home}
Return
0FB8F113-1095-4AA6-BC15-75F4E3B8809F:
;&5  重命名 (父文件夹-)文件、文件夹名
MySel:=QZData("files")
ParentDir:=
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if (A_index=1)
	{
		SplitPath,MyTemFile,MyOutFileName,MyOutDir
		SplitPath,MyOutDir,ParentDir
	}
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%ParentDir%-%MyOutNameNoExt%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%ParentDir%-%MyOutNameNoExt%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
1077C142-B488-4CE1-9C95-01B906C87307:
;&G  LICECap直接开始录制GIF
run apps\LICECap\licecap.exe
sleep 100
send {Space}
sleep 500
clipboard = LiceCap屏幕录制_%A_now% ;增加上面这句，把当前的系统日期发送到剪贴板
Send, ^v{Enter} ;发送 Ctrl + v 和回车
return
Return
1088F1AA-BE60-4958-A514-02117021F4D5:
;&1 重命名 (-当前日期)文件、文件夹名
CurDate=-%a_yyyy%%a_mm%%a_dd%
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
1316277E-C50A-4D42-B9CC-A183DBC4BE8A:
;&T 测试这段 AHK 代码 PipeRun
CustomFunc_PipeRun(gMenuZ.Data.text)
return
Return
16F5433D-C7C8-4053-8ED6-D17F1F356429:
;通用_复制（Ctrl+C）
sendinput,^c
Return
172FCE76-7CBE-42A4-805B-A16885560CE8:
;&C 复制所选文件夹结构
;复制所选文件夹结构		;{
	global	My_SouDirs:=""
	My_SouDirs:=QZData("files")
;}
Return
1B9524F0-B9F3-47F9-94E1-EB2171A5CF41:
;&A  提取全部链接
MySel:=QZData("{text}")
ZZIni=%A_ScriptDir%\User\我的常用正则表达式.txt
fileread,AllZZExpress,%ZZIni%
ZZName:=[]
ZZExpress:=[]
loop ,Parse ,AllZZExpress,`n
{
	StrLine:=trim(A_LoopField)
	if (substr(StrLine,1,3)="功能：") or  (substr(StrLine,1,3)="功能:") {
		StrLine:=StrReplace(StrLine,"功能：","")
		StrLine:=StrReplace(StrLine,"功能:","")
		ZZName.push(StrLine)
		continue
	}
	if (substr(StrLine,1,4)="表达式：") or  (substr(StrLine,1,4)="表达式:") {
		StrLine:=StrReplace(StrLine,"表达式：","")
		StrLine:=StrReplace(StrLine,"表达式:","")
		ZZExpress.push(StrLine)
	}
}
gui,Destroy
Gui Add, Text, x11 y6 w65 h23 +0x200, 正则表达式
Gui Add, Edit, x80 y8 w392 h21 vMyExpress, 
Gui Add, ListView, x9 y72 w464 h265  AltSubmit gZZMyListViewClick, 作用|正则表达式
Gui Add, Button, x80 y39 w65 h25 gZZClean, 清除
Gui Add, Button, x225 y39 w65 h25 Default gZZOK, 提取
Gui Add, Button, x405 y39 w65 h25 gZZEdit, 编辑列表
loop,% ZZName.Length()
	LV_Add("",A_index . "." . ZZName[A_index] , ZZExpress[A_index])
;~ LV_ModifyCol()  
LV_modifycol(1,200)
LV_modifycol(2,250)
Gui Show, w480 h345, 表达式规则


ZZMyListViewClick:
	if A_GuiEvent =Normal 
	{
		LV_GetText(LvText,A_EventInfo,2)
		guiControl,,MyExpress,%LvText%
	}
	if A_GuiEvent= DoubleClick
	{
		LV_GetText(LvText,A_EventInfo,2)
		guiControl,,MyExpress,%LvText%
		gosub,ZZOK
	}
return
	
ZZClean:
	guiControl,,MyExpress,
return

ZZEdit:
	run,%ZZIni%
return

ZZOK:
	GuiControlGet,MyExpress,,MyExpress
	MyMatchArray:=MyFun_RegExMatchAll(MySel,MyExpress)
	OutStr:=""
	i:=1
	while (i<=MyMatchArray.maxindex())
	{
		OutStr.= MyMatchArray[i]  "`n"
		i+=1
	}
	OutStr:=RegExReplace(OutStr,"\s*$","")   ;顺便删除最后的空白行，可根据需求注释掉
	MsgBox, 36, 提取到的数据, %OutStr%`n`n是否复制到 【剪贴板】 ？
	IfMsgBox,Yes
	{
			Clipboard:=OutStr
		gui,Destroy
	}
return

MyFun_RegExMatchAll(ByRef Haystack,NeedleRegEx,SubPat="")
{
	arr:=[],startpos:=1
	while (pos:=Regexmatch(Haystack,NeedleRegEx,match,startPos))
	{
		arr.push(match%SubPat%)
		startPos:=pos+StrLen(match)
	}
	;~ msgbox % arr.MaxIndex()
	return arr.maxindex() ? arr : ""
}
Return
1E20F9AD-55E6-4A3D-A005-065C0DABB539:
;&B  删除PNG文件
My_SouDirs:=QZData("files")
Run, %A_ScriptDir%\Apps\Python\批处理_删除_PNG.py %My_SouDirs%
Return
Return
1F4FB626-CCA0-409E-89A9-A6DB0E183CF3:
;&T  窗口置顶/取消置顶
iHwnd=
iHwnd := gMenuZ.Data.hwnd
if iHwnd=
	WinGet, iHwnd, ID, A
wTitle=
WinGetTitle, wTitle, ahk_id %iHwnd%
X=
Y=
Width=
Height=
WinSet, AlwaysOnTop, Toggle, ahk_id %iHwnd%
WinGetPos, X, Y, Width, Height, ahk_id %iHwnd%
Y:=Y+5
WinGet, ExStyle, ExStyle, ahk_id %iHwnd%
if (ExStyle & 0x8)  ; 0x8 为 WS_EX_TOPMOST.
;  ... 窗口处于置顶状态, 执行适当的动作.
{
	WinSetTitle, ahk_id %iHwnd%, , %wTitle%_已置顶
	SplashImage Off
	SplashImage, % "",X%X% Y%Y% W100 B fs10 CTFFFFFF CW000000,% "窗口已置顶", , 切换模式提示
	WinSet, Transparent, 180, ahk_class AutoHotkey2
	sleep 1300
	SplashImage Off
}
else
{
	wTitle:=RegExReplace(wTitle, "_已置顶")
	WinSetTitle, ahk_id %iHwnd%, , %wTitle%
	SplashImage Off
	SplashImage, % "",X%X% Y%Y% W100 B fs10 CTFFFFFF CW000000,% "取消置顶", , 切换模式提示
	WinSet, Transparent, 180, ahk_class AutoHotkey2
	sleep 1300
	SplashImage Off
}
return
Return
1F4FBC92-215B-4407-BA4B-CEB838BE5408:
;&J  智能解压
 GetFiles:=QZData("{file:path}")
 RunCmd=%A_ScriptDir%\Apps\Kawvin系列软件\Kawvin智能解压\Kawvin智能解压.ahk "%GetFiles%" 
runwait,%RunCmd%
Return
26A17371-954B-42F6-B3FF-1314C4885FD1:
;&N  复制文件名
names := ""
for i, f in StrSplit(QZData("Files"), "`n")
{
	SplitPath, f, name
	names .= name "`n"
}
Clipboard := Trim(names, "`n")
Return
26F14D66-BC21-410D-AED9-448B7ADD426A:
;&W  重命名 删除微信文件后的序号
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if InStr(FileExist(MyTemFile), "D")
		continue
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	MyOutNameNoExt:=RegExReplace(MyOutNameNoExt,"\(\d+?\)","")
	MyNewFile =%MyOutDir%\%MyOutNameNoExt%.%MyOutExt%
	FileMove,%MyTemFile%,%MyNewFile%
}
Return
2C2503E3-9393-4669-9093-08341457939F:
;&2  重命名 文件、文件夹名(-当前日期)
CurDate=-%a_yyyy%%a_mm%%a_dd%
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%MyOutNameNoExt%%CurDate%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%MyOutNameNoExt%%CurDate%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
2C3FEDD3-E083-4BF9-8783-58A9224B362D:
;&T  打开当前目录(TotalCMD)
;获取当前目录
CurWinClass:=QZData("winclass") ;将获取的class名赋值给用户变量
Curhwnd:=QZData("hWnd")
if (CurWinClass="ExploreWClass") or (CurWinClass="CabinetWClass") ;如果当前激活窗口为资源管理器
{
	DirectionDir:=Explorer_GetPath_Kawvin1(Curhwnd)
	IfInString,DirectionDir,`;		;我的电脑、回收站、控制面板等退出
		return
}
if (CurWinClass="WorkerW") or (CurWinClass="Progman") ;如果当前激活窗口为桌面
{
	;DirectionDir=%A_Desktop%
	DirectionDir:=Explorer_GetPath_Kawvin1(Curhwnd)
}
if (CurWinClass="Shell_TrayWnd") ;如果当前激活窗口为任务栏
	return
If(DirectionDir="ERROR")		;错误则退出
	return
;在TC中打开
TLAppPath:=QZData("%TOTALCMD%")
ifnotexist,%TLAppPath%
	return
IfWinNotExist	ahk_class TTOTAL_CMD
	Run,%TLAppPath%,,Max
IfWinNotActive ahk_class TTOTAL_CMD
{
	Postmessage, 1075, 2015, 0,, ahk_class TTOTAL_CMD	;最大化
	WinWait,ahk_class TTOTAL_CMD
	WinActivate
}
PostMessage 1075, 3001, 0, , AHK_CLASS TTOTAL_CMD
ControlSetText, Edit1, cd %DirectionDir%, ahk_class TTOTAL_CMD
Sleep,400
ControlSend, Edit1, {Enter}, ahk_class TTOTAL_CMD
return

Explorer_GetPath_Kawvin1(hwnd="")
{
	if !(window := Explorer_GetWindow_Kawvin1(hwnd))
		return ErrorLevel := "ERROR"
	if (window="desktop")
		return A_Desktop
	path := window.LocationURL
	path := RegExReplace(path, "ftp://.*@","ftp://")
	StringReplace, path, path, file:///
	StringReplace, path, path, /, \, All
	loop
		if RegExMatch(path, "i)(?<=%)[\da-f]{1,2}", hex)
			StringReplace, path, path, `%%hex%, % Chr("0x" . hex), All
		else break
	return path
}

Explorer_GetWindow_Kawvin1(hwnd="")
{
	WinGet, Process, ProcessName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
	WinGetClass class, ahk_id %hwnd%

	if (Process!="explorer.exe")
		return
	if (class ~= "(Cabinet|Explore)WClass")
	{
		for window in ComObjCreate("Shell.Application").Windows
			if (window.hwnd==hwnd)
				return window
	}
	else if (class ~= "Progman|WorkerW")
		return "desktop" ; desktop found
}
Return
30A93E7E-2A8C-458D-AA51-AB63CFB94E0D:
;向下移动
Send {down}
Return
31CD23CD-795D-4335-80F6-FCCCAB6FBE08:
;&8  重命名 修改后缀为RAR
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if InStr(FileExist(MyTemFile), "D")
		continue
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	MyNewFile =%MyOutDir%\%MyOutNameNoExt%.rar
	FileMove,%MyTemFile%,%MyNewFile%
}
Return
31E5EBE5-95CA-46BA-A937-394A5868ACC6:
;&T 在TC中打开
ExplorerPath := QZData("text")
TLAppPath:=QZData("%TOTALCMD%")
ifnotexist,%TLAppPath%
	return
IfWinNotExist	ahk_class TTOTAL_CMD
	Run,%TLAppPath%,,Max
IfWinNotActive ahk_class TTOTAL_CMD
{
	Postmessage, 1075, 2015, 0,, ahk_class TTOTAL_CMD	;最大化
	WinWait,ahk_class TTOTAL_CMD
	WinActivate
}
PostMessage 1075, 3001, 0, , AHK_CLASS TTOTAL_CMD
ControlSetText, Edit1, cd %ExplorerPath%, ahk_class TTOTAL_CMD
Sleep,400
ControlSend, Edit1, {Enter}, ahk_class TTOTAL_CMD
return
Return
32666DED-EC93-4C55-B598-296A848C8A59:
;删除
Send {delete}
Return
32A6B237-989C-49E6-B794-144DE3CFE51A:
;&D  Dos本目录
TempWinClass= % gMenuZ.Data.winclass ;将获取的class名赋值给用户变量
if TempWinClass=
	WinGetClass, TempWinClass, A
if % TempWinClass="ExploreWClass" or TempWinClass="CabinetWClass" ;如果当前激活窗口为资源管理器
{
	ControlGetText, AddressBarText, ToolbarWindow322,ahk_class %TempWinClass% ;通过地址栏获取路径
	stringreplace, AddressBarText, AddressBarText, 地址:%A_space%, , All
	if AddressBarText =
		ControlGetText, AddressBarText, Edit1,ahk_class %TempWinClass%
	if AddressBarText=桌面
		AddressBarText=%A_Desktop%
	if AddressBarText=库\文档
		AddressBarText=%A_MyDocuments%
	if AddressBarText=库\图片
		AddressBarText=%A_MyDocuments%\..\Pictures
	if AddressBarText=库\音乐
		AddressBarText=%A_MyDocuments%\..\Music
	if AddressBarText=库\视频
		AddressBarText=%A_MyDocuments%\..\Videos
	if AddressBarText=库\下载
		AddressBarText=%A_MyDocuments%\..\Downloads
	if AddressBarText=库\图片
		AddressBarText=%A_MyDocuments%\..\Pictures
	;~ if AddressBarText=计算机
		;~ AddressBarText:="::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
	;~ if AddressBarText=回收站
		;~ AddressBarText:="::{645FF040-5081-101B-9F08-00AA002F954E}"
	;~ if AddressBarText=网络
		;~ AddressBarText:="::{208D2C60-3AEA-1069-A2D7-08002B30309D}"
}
if % TempWinClass="WorkerW" or TempWinClass="Progman" ;如果当前激活窗口为桌面
{
	AddressBarText=%A_Desktop%
}
if % TempWinClass="Shell_TrayWnd" ;如果当前激活窗口为任务栏
{
	MsgBox 该操作不适用于任务栏
	Exit
}

if % TempWinClass="TTOTAL_CMD" ;如果当前激活窗口为TC
{
    ClipSaved := ClipboardAll   ; 把剪贴板的所有内容保存到您选择的变量中.
    ; ... 这里临时使用剪贴板, 例如使用 Transform Unicode 粘贴 Unicode 文本 ...
    PostMessage,1075,332,0,,ahk_class TTOTAL_CMD ;把焦点移到来源窗口的地址栏
    PostMessage,1075,2029,0,,ahk_class TTOTAL_CMD ;获取路径
    sleep 80
    AddressBarText= % Clipboard
    Clipboard := ClipSaved   ; 恢复剪贴板为原来的内容. 注意这里使用 Clipboard (不是 ClipboardAll).
    ClipSaved =   ; 在原来的剪贴板含大量内容时释放内存.
    if AddressBarText=\\我的文档
        AddressBarText=%A_MyDocuments%
    if AddressBarText=\\桌面
        AddressBarText=%A_Desktop%
    if AddressBarText=\\回收站
    {
        MsgBox 该操作不适用于回收站
        Exit
    }
}

if InStr(FileExist(AddressBarText), "D")
    Run cmd.exe /k chdir /d "%AddressBarText%"
else
    msgbox 路径错误
TempWinClass=
Return
Return
38B1BED2-B20D-4E73-9526-9FD797082E2F:
;&C  Unicode码转为中文
QZSel:=CustomFunc_QZSel()
Text:=QZSel.text
Text:=CustomFunc_uXXXX2CN(Text)
/*

While pos := RegExMatch(text, "\\u\w{4}")
{
  b := SubStr(text, pos+2, 4)
  b := uXXXX2CN(b)
  text := RegExReplace(text, "\\u\w{4}", b, "", 1)
}
*/

MsgBox, 262145, 转换结果, %text%`n`n======`n`n确定：复制到剪贴板`n取消：直接退出
ifmsgbox, yes
	Clipboard:=Text

return
Return
394B3DA8-7799-4918-9728-FCD2A834D687:
;通用_向右
sendinput,{right}
Return
397D6E8C-74CB-4178-98E9-5686E80CA211:
;&P  复制快捷方式目标路径
MySel :=QZData("files")
FileGetShortcut,%MySel%,MyTempfile
clipboard := MyTempfile
Return
3D47D2E0-C217-4AE6-9F4E-CD9E774D8969:
;&U  中文转为 Unicode码
MySel:=QZData("{text}")
Curhwnd:=QZData("hWnd")
MyOutText:=CN2uXXXX(MySel)
/*
clipboard:=MyOutText
WinActivate,Ahk_ID %Curhwnd%
sleep,100
Send,^{vk56}
*/

MsgBox, 262145, 转换结果, %MyOutText%`n`n======`n`n确定：复制到剪贴板`n取消：直接退出
ifmsgbox, yes
	Clipboard:=MyOutText
return
Return
3E9DF267-3458-46F5-8C32-30D617042F2D:
;通用_定位文档结尾（Ctrl+End）
send,^{end}
Return
3F7F9DBF-F2BA-4FFD-B45F-64F46B2DBC86:
;&a  批量压缩 以caesiumclt
Gui Destroy
Gui Add, GroupBox, x10 y0 w410 h43, 压缩比(快捷键：1-9)
Gui Add, Radio, x20 y15 w40 h23 vCae_Value gCae_Compress, &10
Gui Add, Radio, x65 y15 w40 h23 gCae_Compress, &20
Gui Add, Radio, x110 y15 w40 h23 gCae_Compress, &30
Gui Add, Radio, x155 y15 w40 h23 gCae_Compress, &40
Gui Add, Radio, x200 y15 w40 h23 gCae_Compress, &50
Gui Add, Radio, x245 y15 w40 h23 gCae_Compress, &60
Gui Add, Radio, x290 y15 w40 h23 gCae_Compress, &75
Gui Add, Radio, x335 y15 w40 h23 gCae_Compress, &80
Gui Add, Radio, x380 y15 w40 h23 gCae_Compress, &90
Gui Show, , caesiumclt压缩(By_Kawvin)
Return

Cae_Compress:
gui,Submit
Cae_ValueArray:={1:10,2:20,3:30,4:40,5:50,6:60,7:75,8:80,9:80}
Cae_Value:=Cae_ValueArray[Cae_Value]
MySel:=QZData( "{file:path}"  )
cae:=QZData( "%caesiumclt%")
Loop, Parse, MySel, `n
{
    if A_LoopField =  ; 忽略列表末尾的最后一个换行符 (空项).
        continue
	SplitPath,A_LoopField,,MyPath
	Tooltip 当前第【%A_Index%】个文件`n%A_LoopField%
	MyCmdline=%cae% -q %Cae_Value% -o `"%MyPath%`"\ `"%A_LoopField%`"
	runwait,%ComSpec% /c "%MyCmdline%",,Hide
}
Tooltip
Return
40FAD112-AEF9-443B-ADFA-5EB67AA434BF:
;&C  文件、文件夹复制到(...)
MySel:=QZData("files")
FileSelectFolder,MySelDir,*,3
if (MySelDir="")
	return
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile, SourceFolderName ; 仅从它的完全路径提取文件夹名称。
	if InStr(FileExist(MyTemFile), "D")  ;区分是否文件夹,Attrib= D ,则是文件夹
		FileCopyDir, %MyTemFile%, %MySelDir%\%SourceFolderName%、
	else
		FileCopy,%MyTemFile%,%MySelDir%
}
Return
447B0C56-DD7C-454E-BF8A-9ABEB0D1CBEE:
;&H  添加分隔符合并行
MySel:=QZData("{text}")
Curhwnd:=QZData("hWnd")
InputBox,MyTemInput,请输入搜索内容,,,200,100
if ErrorLevel
	return
MsgBox, 36, 提示, 是否自动删除空白行？
IfMsgBox,Yes
	DelEmptyLine:=1
else
	DelEmptyLine:=0
MsgBox, 36, 提示, 是否自动删除格？
IfMsgBox,Yes
	MyAutoTrim:=1
else
	MyAutoTrim:=0
Aligned:=""
loop, Parse, MySel, `n,`r                   ;首先求得左边最长的长度，以便向它看齐
{
	if DelEmptyLine
	{
		if (A_loopfield="")
			continue
	}
	if MyAutoTrim
		Aligned .= MyTemInput trim(A_loopfield) 
	else
		Aligned .= MyTemInput A_loopfield
}
if(MyTemInput!="")
	Aligned:=substr(Aligned,2)   ;删除最前面的分隔符
Aligned:=RegExReplace(Aligned,"\s*$","")   ;删除最后的空白行，可根据需求注释掉
clipboard := Aligned
WinActivate,Ahk_ID %Curhwnd%
sleep,100
Send,^{vk56}
Return
44DD3569-CF7D-45C3-8DF9-28DC98DE991A:
;通用_向上
sendinput,{up}
Return
4B94C395-7BD8-4253-A832-F0032A2A70C1:
;向左移动
Send {Left}
Return
50474B9E-2802-4F93-8E4E-29EBE7712179:
;通用_VIMD显示热键帮助
QZ_VIMD_ShowKeyHelp()
Return
52783379-56CB-471B-85CC-2ABCE5F9747B:
;切换为普通模式
vimd.changemode("普通模式")
Return
574404D4-B9A0-47EB-B2D1-523F84D06DC8:
;左键事件监控 (&L)
Run "%A_AhkPath%"  "\QuickZ\Apps\AutoHotkey\左键事件监控.ahk"
Return
5804E002-0C49-4706-BEBD-F0F4029B9D82:
;&Z  打开当前目录(资源管理器)
CurWinClass:=QZData("winclass") ;将获取的class名赋值给用户变量
if (CurWinClass="TTOTAL_CMD") ;如果当前激活窗口为TC
{
	IfWinNotActive ahk_class TTOTAL_CMD
	{
		Postmessage, 1075, 2015, 0,, ahk_class TTOTAL_CMD	;最大化
		WinWait,ahk_class TTOTAL_CMD
		WinActivate
	}
	Postmessage, 1075, 332, 0,, ahk_class TTOTAL_CMD	;光标定位到焦点地址栏
	sleep 300
	PostMessage,1075,2029,0,,ahk_class TTOTAL_CMD ;获取路径
	sleep 100
	DirectionDir:=Clipboard
}
If(DirectionDir="ERROR")		;错误则退出
	return
;在资源管理器中打开
run, %DirectionDir%
return

Return
5814FFBE-E4A1-4B04-AB77-025808FEAE04:
;通用_查找（Ctrl+F）
    sendinput,^f
Return
58884004-2A29-448B-B764-AF618C06B993:
;&X  窗口大小改变
Curhwnd:=QZData("hWnd")
WinActivate,Ahk_ID %Curhwnd%
winGetPos,X,Y,Width,Height,A
CurWidth:=1080
CurHeight:=900
if (Width/CurWidth>1.5)
winmove,A,,,,%CurWidth%,%CurHeight%
else
WinMaximize,A
WinMove, A,, (A_ScreenWidth/2)-(CurWidth/2), (A_ScreenHeight/2)-(CurHeight/2)
Return
5B275BC7-183C-48D0-A8D7-B37DD936F123:
;&Z  打开快捷方式所指目录(资源管理器)
MySel:=QZData("files" )
FileGetShortcut,%MySel%,MyTemFile
SplitPath,MyTemFile,,MyOutDir
;MyCmdLine=explorer.exe /select,%dir%
;msgbox % MyCmdLine
;run,% MyCmdLine
;Run,explorer.exe /select`,%MyOutDir%
Run,explorer.exe /open`,%MyOutDir%
;Run,% "explorer.exe /select,dir"
;Run, % "explorer.exe /open,dir"
Return
5F3202DE-BBF2-4754-8B4E-C565508EFF52:
;Spy++ (&S)
Run "%A_AhkPath%" "\QuickZ\Apps\AutoHotkey\Ahkspy++.ahk"
Return
5FBD2A36-9BD7-4413-B1FC-6DE2E3010706:
;向上移动
Send {Up}
Return
60BA26B8-DAC4-4F17-B1BC-9C91F5C83E1E:
;&Z 在资源管理器打开
ExplorerPath := QZData("text")
run, %ExplorerPath%
return
Return
613B7685-1E61-4A8C-8190-577E8C66D77A:
;&W  所选文本转到 Word 中编辑
clipboard := QZData("text")
MyAppPath:=QZData("%winword%")
run ,"%MyAppPath%"
sleep 2000
send {enter}
sleep 2000
send ^v
return
Return
61E935C6-1D8E-4A68-BB67-3AC9C60D671D:
;&C 关闭显示标题栏
biaotyic+=1
MouseGetPos , , , btwid ,  ; 得到鼠标所在位置窗口的id及控件名称
if biaotyic>0
{
WinSet, Style, -0xC00000,ahk_id %btwid%; 移除活动窗口的标题栏 (WS_CAPTION).
biaotyic*=-1
}
else
{
WinSet, Style, +0xC00000,ahk_id %btwid%; 恢复活动窗口的标题栏 (WS_CAPTION).
}
return
Return
6222F723-F639-4C4E-98E7-BDFCDF717D8B:
;&T  智能统一压缩(Ctrl:命名 Shift:加密 Caps:删除)
MyKeyStatus:=
if GetKeyState("Ctrl")
	MyKeyStatus.="Ctrl"
if GetKeyState("Shift")
	MyKeyStatus.="Shift"
if GetKeyState("Alt")
	MyKeyStatus.="Alt"
if GetKeyState("Win")
	MyKeyStatus.="Win"
if GetKeyState("CapsLock", "T")
	MyKeyStatus.="Caps"

MySel= % QZData("files")
MyParentPath:=
loop,Parse,MySel,`n     ;读取第一行所在目录
{
	SplitPath,A_loopfield,,MyParentPath
	break
}
SplitPath,MyParentPath,,,,MyZipFile		;获取所在目录名称
if (instr(MyKeyStatus,"Ctrl")>0)		;按住Ctrl则要求输入文件名，否则以所选文件所在目录名称为压缩文件名
{
	InputBox, MyInput, 提示,`n请输入压缩文件名称`n`n如果为空，则默认使用所选文件所在目录名称
	if MyInput!=
		MyZipFile=%MyInput%
}
MyZipFile:=MyParentPath . "\" . MyZipFile	;压缩文件名称，无后缀
if (instr(MyKeyStatus,"Shift")>0)	;按住Shift则要求输入密码
{
	InputBox, MyPsw, 提示,`n请输入加密密码`n`n如果为空，则默认不加密`n加密文件名,密码形式为 xxxx`|x ，压缩格式为7z
	if ErrorLevel
		MyPsw:=
} else
	MyPsw:=
if (instr(MyKeyStatus,"Caps")>0)	;Caps如果按下，则压缩后删除文件
	MyDelete:=1
else
	MyDelete:=0

Zip7=%A_ScriptDir%\Apps\7-Zip\7zg.exe		;7zg所在目录

if !InStr(MySel,"`n")  ;若不是多文件则执行下列命令，以所选文件为压缩文件名
{
	if InStr(FileExist(MySel), "D") ;若为文件夹则执行下来命令
	{
		SplitPath, MySel, name, dir, ext, name_no_ext, Drive
		Loop, %MySel%\* ,1   ;1表示获取文件夹文件夹.
		{
			if A_Index=1
			{
				File=% A_LoopFileFullPath
				continue
			}
			File.= "`r" . "`n" . A_LoopFileFullPath
		}
		MyFileList := RegExReplace(File, "\r\n", """ """) 
		MySub_7ZipAddAll(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete)
		if MyDelete
		{
			loop,Parse,MyFileList,`n,`r
			{
				if InStr(FileExist(A_LoopField), "D")
					FileRemoveDir,%A_LoopField%
				else
					FileDelete,%A_LoopField%
			}
		}
		return
	} else  {
		MyFileList:=MySel
		MySub_7ZipAddAll(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete)
		if MyDelete
		{
			loop,Parse,MyFileList,`n,`r
			{
				if InStr(FileExist(A_LoopField), "D")
					FileRemoveDir,%A_LoopField%
				else
					FileDelete,%A_LoopField%
			}
		}
		return
	}
}

Loop,Parse,MySel,`n,`r  ;若为多文件，则执行下列命令,以上一级文件名为压缩文件名
{
	SplitPath, A_LoopField, name2, dir, ext, name_no_ext, Drive
	if A_Index=1
	{
		File=% A_LoopField
		continue
	}
	File.= "`r" . "`n" . A_LoopField
}
MyFileList := RegExReplace(File, "\r\n", """ """)  
MySub_7ZipAddAll(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete)
if MyDelete
{
	loop,Parse,MyFileList,`n,`r
	{
		if InStr(FileExist(A_LoopField), "D")
			FileRemoveDir,%A_LoopField%
		else
			FileDelete,%A_LoopField%
	}
}
return

;~ 压缩过程，Zip7=7Zip路径,MyFileList=要压缩的文件列表,MyZipFile=压缩文件名称，MyPsw=密码,MyDelete=是否删除，1为删除
;~ MySub_7ZipAddAll(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete:=0)
MySub_7ZipAddAll(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete:=0)
{
	if MyPsw!=
	{
		StringSplit,MyArray_PSW,MyPSW,`|
		if MyArray_PSW2!=
		{
			MyZipFile:=MySub_CheckExistAll(MyZipFile,"7z")
			MyCmdLine=%Zip7% a "%MyZipFile%" `-p%MyArray_PSW1% -mhe "%MyFileList%"
		} else {
			MyZipFile:=MySub_CheckExistAll(MyZipFile,"zip")
			MyCmdLine=%Zip7% a "%MyZipFile%" `-p%MyArray_PSW1% "%MyFileList%"
		}
	} else {
		MyZipFile:=MySub_CheckExistAll(MyZipFile,"zip")
		MyCmdLine=%Zip7% a "%MyZipFile%" "%MyFileList%"
	}
	Run,%MyCmdLine%,,UseErrorLevel
	;~ if MyDelete
	;~ {
		;~ loop,Parse,MyFileList,`n,`r
		;~ {
			;~ if InStr(FileExist(A_LoopField), "D")
				;~ FileRemoveDir,%A_LoopField%
			;~ else
				;~ FileDelete,%A_LoopField%
		;~ }
	;~ }
}

MySub_CheckExistAll(FileNameNoExt,ext)
{
	IfExist,%FileNameNoExt%.%ext%   ;已经存在了以“首层文件夹命名”的文件夹，怎么办？
	{
		Loop
		{
			FolderName=%FileNameNoExt%( %A_Index% ).%ext%
			If !FileExist( FolderName )
			{
				return, %FolderName%
				break
			}
		}
		return
	}
	FolderName=%FileNameNoExt%.%ext%
	return, %FolderName%
}

Return
62DE1F60-9A56-4E63-9809-DDF7C6A61E88:
;&Q  和此QQ好友聊天
clipboard := QZData("text")
;If ! (RegExMatch(Clipboard,"^[0-9]{5,11}$"))  ;限定qq的位数为5--11位
;return
;else
run,tencent://message/?uin=%clipboard%&fuin=105224583
;uin是要发起的对象，fuin是谁要发起,如果电脑登录了一个以上的qq的话加上fuin可以控制你要发起的那个qq号，如果电脑只登陆了一个qq，fuin参数可以去掉
return
Return
651CA150-2ED2-43CF-9F29-1AEF408301B0:
;&3 文档前加★
CurDate=★
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
6B71D7B2-343C-411F-ADF1-CA4589048491:
;通用_PageDown
Send {PgDn}
Return
6BD3562F-C2DA-4083-A48C-3EC25A6F2392:
;&P  使用Foxit_Phantom批量合并文件
MySel:=QZData( "Files" )
MyPath:=QZData( "{file:dir}"  )
msgbox % MyPath
return
run "%A_ahkpath%" "%A_ScriptDir%\Apps\使用Foxit_Phantom批量合并文件.ahk" "%MySel%"
Return
6E1B4536-C2C0-40F7-A775-95212189C487:
;切换为VIM模式
vimd.changemode("VIM模式")
Return
6F00D8B5-1569-44C3-B4C8-7471EEC391D1:
;&4 文档前加●
CurDate=●
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%CurDate%%MyOutNameNoExt%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
735F68F8-3898-434E-A2E3-80564EAD0A0C:
;&W  比较 Word比较文档
MySel:=QZData("files")
MyParentPath:=
LeftFile:=
RightFile:=mc
loop,Parse,MySel,`n     ;循环读取每一行
{
	if A_index=1
	{
		SplitPath,A_loopfield,,MyParentPath
		LeftFile:=A_loopfield
	}
	if A_index=2
		RightFile:=A_loopfield
}
MsgBox, 35, 数据确认, 请确认数据：`n原始文档：%LeftFile%`n修订文档：%RightFile%`n`n如果不正确，按【否】交换，按【取消】取消
IfMsgBox,Cancel
	return
IfMsgBox,no
{
	TempFile:=LeftFile
	LeftFile:=RightFile
	RightFile:=TempFile
}
;打开程序并加载
AppPath:=QZData("%WinWord%")
;AppPath:="c:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE"
run,%AppPath%
WinWaitActive ,ahk_class OpusApp,,15
if ErrorLevel
{
    MsgBox, 打开Word超时
    return
}
sendinput,{alt down}    ;分开写，避免与其他截图类软件冲突
sleep,50
sendinput,{alt up}
sleep,300
sendinput,r
sleep,300
sendinput,m
sleep,300
sendinput,c
sleep,1500
;controlclick,MsoCommandBar1,ahk_class bosa_sdm_msword
sendinput,{tab}
sleep,300
sendinput,{enter}
sleep,1500
Clipboard=%LeftFile%
sendinput,^v
sleep,500
sendinput,{enter}
sleep,1000
;controlclick,MsoCommandBar2,ahk_class bosa_sdm_msword
sendinput,{tab 2}
sleep,300
sendinput,{enter}
sleep,1500
Clipboard=%RightFile%
sendinput,^v
sleep,500
sendinput,{enter}
;sleep,1000
;sendinput,{tab 4}
;sleep,300
;sendinput,{enter}


Return
77C8BC15-CBE1-4D1D-A4E6-1A9D40EF9415:
;&B  删除BT种子
CurDir:=CustomFunc_getCurrentDir()
MyCmdLines=
(lefttrim
attrib -h "%CurDir%"\*.torrent
del /s "%CurDir%"\*.torrent
;del /s "%CurDir%"\*.mht
;del /s "%CurDir%"\*.htm
;del /s "%CurDir%"\*.txt
)
loop,Parse,MyCmdLines,`n,`r
{
	if (A_LoopField!="") && (substr(A_LoopField,1,1)!=";")
		;~ msgbox,%ComSpec% /c %A_LoopField%
		run,%ComSpec% /c %A_LoopField%
}
Return
782CC135-06F4-43DE-AE29-9E8C2CAC433B:
;&9  重命名 修改后缀为ZIP
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if InStr(FileExist(MyTemFile), "D")
		continue
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	MyNewFile =%MyOutDir%\%MyOutNameNoExt%.zip
	FileMove,%MyTemFile%,%MyNewFile%
}
Return
7A7707F8-5351-4613-92D6-E9C1A14FD9A3:
;&T  所选文件保存到【D:\@Index\临时文件\】文件夹
SavePath:="D:\@Index\临时文件\"
SaveText:=QZData("{text}")
CurDate=%a_yyyy%%a_mm%%a_dd%-
TxtName:=
MySaveName:=
loop,Parse,SaveText,`n     ;循环读取每一行
{
	TxtName := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	TxtName:=Trim(TxtName)
	StringReplace,TxtName,TxtName,`,,,all
	StringReplace,TxtName,TxtName,`\,,all
	StringReplace,TxtName,TxtName,`/,,all
	StringReplace,TxtName,TxtName,`:,,all
	StringReplace,TxtName,TxtName,`*,,all
	StringReplace,TxtName,TxtName,`?,,all
	StringReplace,TxtName,TxtName,`<,,all
	StringReplace,TxtName,TxtName,`>,,all
	StringReplace,TxtName,TxtName,`|,,all
	if TxtName!=
	{
		FirstLineLen:=StrLen(TxtName)
		if FirstLineLen>20
			TxtName:=SubStr(TxtName,1,20)
		break
	}
}
if (substr(SavePath,-1)!="\")
	SavePath=%SavePath%\
if SavePath!=
	MySaveName=%SavePath%%CurDate%%TxtName%`.txt
ifnotexist,%SavePath%
	FileCreateDir,%SavePath%
ifnotexist,%SavePath%
{
	MsgBox, 16, 错误提示, 保存目录：【%SavePath% 】不存在！`n`n【确认】后退出
	return
}
MyWF:=FileOpen(MySaveName,"rw")
if !IsObject(MyWF)
{
	MsgBox 不能打开写入 %MySaveName% 文件
	return
} else {
	MyWF.Write(SaveText)
	MyWF.Close()
}
Return
7C2F6336-8285-4A76-9942-D1302E76095B:
;&D  等号对齐
MySel:=QZData("{text}")
Curhwnd:=QZData("hWnd")
LimitMax:=90     ;左侧超过该长度时，该行不参与对齐，该数字可自行修改
MaxLen:=0
StrSpace:=" "
loop,% LimitMax+1
	StrSpace .=" "
Aligned:=
loop, Parse, MySel, `n,`r                   ;首先求得左边最长的长度，以便向它看齐
{
	IfNotInString,A_loopfield,=              ;本行没有等号，过
		continue
	ItemLeft :=RegExReplace(A_LoopField,"\s*(.*?)\s*=.*$","$1")        ;本条目的 等号 左侧部分
	ThisLen:=StrLen(RegExReplace(ItemLeft,"[^\x00-\xff]","11"))       ;本条左侧的长度
	MaxLen:=( ThisLen > MaxLen And ThisLen <= LimitMax) ? ThisLen : MaxLen       ;得到小于LimitMax内的最大的长度，这个是最终长度
}
loop, Parse, MySel, `n,`r
{
	IfNotInString,A_loopfield,=
	{
		Aligned .= A_loopfield "`r`n"
		continue
	}
	ItemLeft:=Trim(RegExReplace(A_LoopField,"\s*=.*?$") )        ;本条目的 等号 左侧部分
	ItemRight:=Trim(RegExReplace(A_LoopField,"^.*?=")  )          ;本条目的 等号 右侧部分
	ThisLen:=StrLen(RegExReplace(ItemLeft,"[^\x00-\xff]","11"))   ;本条左侧的长度
	if ( ThisLen> MaxLen )       ;如果本条左侧大于最大长度，注意是最大长度，而不是LimitMax，则不参与对齐
	{
		Aligned .= ItemLeft  "= " ItemRight "`r`n"
		continue
	}
	else
	{
		Aligned .= ItemLeft . SubStr( StrSpace, 1, MaxLen+2-ThisLen ) "= " ItemRight "`r`n"        ;该处给右侧等号后添加了一个空格，根据需求可删
	}
}
Aligned:=RegExReplace(Aligned,"\s*$","")   ;顺便删除最后的空白行，可根据需求注释掉
clipboard := Aligned
WinActivate,Ahk_ID %Curhwnd%
sleep,100
Send,^{vk56}
Return
7D252D2A-950F-4B67-B385-8A8593BE652D:
;通用_向下
sendinput,{down}
Return
7E52CF8F-29CC-4C45-A14F-8CA7A8D2FC46:
;&1  一键启动-通讯类软件
CurDPI:=A_ScreenDPI
MyScale:=CurDPI/96
run , % QZData("%wechat%")
;sleep,2000
WinWaitActive, ahk_class WeChatLoginWndForPC, , 5
CurX:=140*MyScale
CurY:=280*MyScale
ControlClick, x%CurX% y%CurY%, ahk_class WeChatLoginWndForPC,,,, Pos

run , % QZData("%QQ%")
;sleep,2000
WinWaitActive, ahk_class TXGuiFoundation, , 5
CurX:=250*MyScale
CurY:=370*MyScale
ControlClick, x%CurX% y%CurY%, ahk_class TXGuiFoundation,,,, Pos

Return
806BEC8E-D27C-4BD7-8903-458159E0F9BD:
;通用_PageUp
Send {PgUp}
Return
82E8C1CC-26E5-4611-8438-D9B691C0E430:
;&G  智能各自压缩(Shift:加密 Caps:删除)
MyKeyStatus:=
if GetKeyState("Ctrl")
	MyKeyStatus.="Ctrl"
if GetKeyState("Shift")
	MyKeyStatus.="Shift"
if GetKeyState("Alt")
	MyKeyStatus.="Alt"
if GetKeyState("Win")
	MyKeyStatus.="Win"
if GetKeyState("CapsLock", "T")
	MyKeyStatus.="Caps"

if (instr(MyKeyStatus,"Shift")>0)
	InputBox, MyPsw, 提示,`n请输入加密密码`n`n如果为空，则默认不加密`n加密文件名,密码形式为 xxxx`|x ，压缩格式为7z
else
	MyPsw:=

MySel= % QZData("files")
;msgbox % MySel

MyZipFile:=

if (instr(MyKeyStatus,"Caps")>0)
	MyDelete:=1
else
	MyDelete:=0

Zip7=%A_ScriptDir%\Apps\7-Zip\7zg.exe

loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,,MyOutDir,,MyOutNameNoExt
	MyFileList:=
	MyZipFile:=MyOutDir
	if InStr(FileExist(MyTemFile), "D")
	{
		Loop, %MyTemFile%\* ,1   ;1表示获取文件夹文件夹.
		{
			if A_Index=1
			{
				File=% A_LoopFileFullPath
				continue
			}
			File.= "`r" . "`n" . A_LoopFileFullPath
		}
		MyFileList := RegExReplace(File, "\r\n", """ """) 
	} else {
		MyFileList:=MyTemFile
	}
	;msgbox % MyFileList
		MyZipFile.= "\" MyOutNameNoExt
		MySub_7ZipAddEach(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete)
		if MyDelete
		{
			loop,Parse,MyFileList,`n,`r
			{
				if InStr(FileExist(A_LoopField), "D")
					FileRemoveDir,%A_LoopField%
				else
					FileDelete,%A_LoopField%
			}
		}
}

;~ 压缩过程，Zip7=7Zip路径,MyFileList=要压缩的文件列表,MyZipFile=压缩文件名称，MyPsw=密码,MyDelete=是否删除，1为删除
;~ MySub_7ZipAddEach(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete:=0)
MySub_7ZipAddEach(Zip7,MyFileList,MyZipFile,MyPsw,MyDelete:=0)
{
	if MyPsw!=
	{
		StringSplit,MyArray_PSW,MyPSW,`|
		if MyArray_PSW2!=
		{
			MyZipFile:=MySub_CheckExistEach(MyZipFile,"7z")
			MyCmdLine=%Zip7% a "%MyZipFile%" `-p%MyArray_PSW1% -mhe "%MyFileList%"
		} else {
			MyZipFile:=MySub_CheckExistEach(MyZipFile,"zip")
			MyCmdLine=%Zip7% a "%MyZipFile%" `-p%MyArray_PSW1% "%MyFileList%"
		}
	} else {
		MyZipFile:=MySub_CheckExistEach(MyZipFile,"zip")
		MyCmdLine=%Zip7% a "%MyZipFile%" "%MyFileList%"
	}
	Run,%MyCmdLine%,,UseErrorLevel
	;~ if MyDelete
	;~ {
		;~ loop,Parse,MyFileList,`n,`r
		;~ {
			;~ if InStr(FileExist(A_LoopField), "D")
				;~ FileRemoveDir,%A_LoopField%
			;~ else
				;~ FileDelete,%A_LoopField%
		;~ }
	;~ }
}

MySub_CheckExistEach(FileNameNoExt,ext)
{
	IfExist,%FileNameNoExt%.%ext%   ;已经存在了以“首层文件夹命名”的文件夹，怎么办？
	{
		Loop
		{
			FolderName=%FileNameNoExt%( %A_Index% ).%ext%
			If !FileExist( FolderName )
			{
				return, %FolderName%
				break
			}
		}
		return
	}
	FolderName=%FileNameNoExt%.%ext%
	return, %FolderName%
}
Return
862E9673-348C-4C76-8EBB-82505593AE67:
;通用_向左
sendinput,{left}
Return
8B416C08-59B6-4205-A8F3-205906EC7D6B:
;&C  查询快递
MsgBox % 查快递(QZData("text"))
return
; By run QQ：1324424600

查快递(id){
;~ 200382770316   圆通
;~ 9890520041154 邮政国内
;~ 409173423798  中通
url := "https://www.kuaidi100.com/autonumber/autoComNum?text="	id	 ;post发送contents内容notepad.cc里面
快递公司:=json_toobj(URLDownloadToVar(url,"utf-8","POST")	)

;MsgBox % 快递公司.auto[1].comcode

xingcheng_url:="https://www.kuaidi100.com/query?type=" 快递公司.auto[1].comcode "&postid=" id "&id=1"
;~ MsgBox % neirong.auto[1].comcode
;~ xingcheng:=json_toobj(URLDownloadToVar(xingcheng_url,"utf-8","POST"))
while !URLDownloadToVar(xingcheng_url,"utf-8","POST")
	sleep 1000
xingcheng:=json_toobj(URLDownloadToVar(xingcheng_url,"utf-8","POST"))
for k , v in xingcheng.data
	行程.=v.time "`t" . v.context "`n"
return 行程
}




URLDownloadToVar(url, Encoding = "",Method="GET",postData=""){ ;网址，编码,请求方式，post数据
    hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
    if Method = GET
    {
        Try
        {
            hObject.Open("GET",url)
            hObject.Send()
        }
        catch e
            return -1
    }
    else if Method = POST
    {
        Try
        {
            hObject.Open("POST",url,False)
            hObject.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
            hObject.Send(postData)
        }
        catch e
            return -1
    }
 
    if (Encoding && hObject.ResponseBody)
    {
        oADO := ComObjCreate("adodb.stream")
        oADO.Type := 1
        oADO.Mode := 3
        oADO.Open()
        oADO.Write(hObject.ResponseBody)
        oADO.Position := 0
        oADO.Type := 2
        oADO.Charset := Encoding
        return oADO.ReadText(), oADO.Close()
    }
    return hObject.ResponseText
}

Headers(referer = "")
{
    global userAgent
    if !userAgent				;如果没指定userAgent，则指定给他userAgent为IE8   ，userAgent和Referer一般复制浏览器里面得到的数据就行
        userAgent := "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)"   ;IE8的默认userAgent
    Headers =
    ( LTRIM
        Referer: %referer%
        User-Agent: %userAgent%
    )
    return Headers
}


json_toobj(str){
	quot := """"
	ws := "`t`n`r " Chr(160)
	obj := {}
	objs := []
	keys := []
	isarrays := []
	literals := []
	y := nest := 0
	StringGetPos, z, str, %quot%
	while !ErrorLevel
	{
		StringGetPos, x, str, %quot%,, % z + 1
		while !ErrorLevel
		{
			StringMid, key, str, z + 2, x - z - 1
			StringReplace, key, key, \\, \u005C, A
			if SubStr( key, 0 ) != "\"
				break
			StringGetPos, x, str, %quot%,, % x + 1
		}
		str := ( z ? SubStr( str, 1, z ) : "" ) quot SubStr( str, x + 2 )
		StringReplace, key, key, \%quot%, %quot%, A
		StringReplace, key, key, \b, % Chr(08), A
		StringReplace, key, key, \t, % A_Tab, A
		StringReplace, key, key, \n, `n, A
		StringReplace, key, key, \f, % Chr(12), A
		StringReplace, key, key, \r, `r, A
		StringReplace, key, key, \/, /, A
		while y := InStr( key, "\u", 0, y + 1 )
		if ( A_IsUnicode || Abs( "0x" SubStr( key, y + 2, 4 ) ) < 0x100 )
			key := ( y = 1 ? "" : SubStr( key, 1, y - 1 ) ) Chr( "0x" SubStr( key, y + 2, 4 ) ) SubStr( key, y + 6 )
		literals.Insert(key)
		StringGetPos, z, str, %quot%,, % z + 1
	}
	key := isarray := 1
	Loop Parse, str, % "]}"
	{
		StringReplace, str, A_LoopField, [, [], A
		Loop Parse, str, % "[{"
		{
			if ( A_Index != 1 )
			{
				objs.Insert( obj )
				isarrays.Insert( isarray )
				keys.Insert( key )
				obj := {}
				isarray := key := Asc( A_LoopField ) = 93
			}
			if ( isarray )
			{
				Loop Parse, A_LoopField, `,, % ws "]"
					if ( A_LoopField != "" )
						obj[key++] := A_LoopField = quot ? literals.Remove(1) : A_LoopField
			}
			else
			{
				Loop Parse, A_LoopField, `,
					Loop Parse, A_LoopField, :, % ws
						if ( A_Index = 1 )
							key := A_LoopField = quot ? literals.Remove(1) : A_LoopField
						else if ( A_Index = 2 && A_LoopField != "" )
							obj[key] := A_LoopField = quot ? literals.Remove(1) : A_LoopField
			}
			nest += A_Index > 1
		}
		if !--nest
			break
		pbj := obj
		obj := objs.Remove()
		obj[key := keys.Remove()] := pbj
		if ( isarray := isarrays.Remove() )
			key++
	}
return obj
}
Return
8CAA531A-2593-42A5-87E4-5C49E606832F:
;&F  扫描图标保存到文件夹
FileSelectFolder, SaveDir, *, 3，请选择要保存图标的目录
if SaveDir!=
{
    if (substr(SaveDir,-1)!="\")
        SaveDir=%SaveDir%\
    GetFiles:=QZData("{file:path}")
    ;GetFiles:=QZData("files")
    RunCmd=Apps\iconsext\iconsext.exe /Save  "%GetFiles%"  "%SaveDir%"  -icons
   ;msgbox % RunCmd
   run ,% RunCmd
}
Return
8D5DC3B9-C354-4909-AC23-CD021BDDCD79:
;&C 关闭所有资源管理器
GroupAdd, Explore, ahk_class CabinetWClass
GroupClose, Explore, A
return
Return
8FDD2126-1CC2-4EFF-A813-36AAB0D08B6D:
;通用_剪贴（Ctrl+X）
    sendinput,^x
Return
90FCB555-4981-4673-A613-EB4EAE15D977:
;通用_替换（Ctrl+H）
    sendinput,^h
Return
97DF9E41-B0BB-4042-824D-8E5490DC157D:
;&M  转换为AHK原义延续片段
ResumeWin()
PreClipboard:=ClipboardAll
QZSel:=CustomFunc_QZSel()
Clipboard:=CustomFunc_TextEscaping2ContinuationSection(QZSel.text)

Send ^v
Clipboard:=PreClipboard
return
Return
98C21098-2798-4754-9EAE-1FD38F332847:
;&0  重命名 修改后缀为(输入内容)
MySel:=QZData("files")
InputBox, MyNewExt, 提示,请输入新的后缀名
if (MyNewExt="")
	return
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if InStr(FileExist(MyTemFile), "D")
		continue
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	MyNewFile =%MyOutDir%\%MyOutNameNoExt%.%MyNewExt%
	FileMove,%MyTemFile%,%MyNewFile%
}
Return
9A114C18-B742-49E4-A426-EEA446041B0D:
;回到行前并切换模式
Send {Home}
vimd.changemode("普通模式")
Return
9AC81CCE-439A-4FA4-9951-7BC721C8256D:
;通用_返回（Esc）
sendinput,{esc}
Return
9D9341F2-A757-4F5D-9FA9-C20641E83C18:
;&J  所选文本转到 Notepad++ 中编辑
AppPath:=QZData("%NotePadJJ%")
clipboard:=QZData("{Text}" )
ifnotexist,%AppPath%
	return
IfWinNotExist	ahk_class Notepad`+`+	;如果SciTE4没有打开
{
	Run,%AppPath%,,Max
	WinWait,ahk_class Notepad`+`+,,5
	if ErrorLevel		;如果5秒没激活，则退出
		return
	WinActivate
sendinput,^n
	sleep,300
	send,^{vk56}
}
IfWinNotActive ahk_class Notepad`+`+
{
	Run,%AppPath%,,Max
	WinWait,ahk_class Notepad`+`+,,5
	if ErrorLevel			;如果5秒没激活，则退出
		return
	WinActivate
	sendinput,^n
	sleep,300
	send,^{vk56}
}
clipboard:=
Return
9EE5E9A0-6BB9-4525-81D2-F462B831CAA2:
;&7  重命名 添加后缀为(输入内容)
MySel:=QZData("files")
InputBox, MyNewExt, 提示,请输入新的后缀名
if (MyNewExt="")
	return
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if InStr(FileExist(MyTemFile), "D")
		continue
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	MyNewFile =%MyOutDir%\%MyOutFileName%.%MyNewExt%
	FileMove,%MyTemFile%,%MyNewFile%
}
Return
A11B0398-3508-4CFE-AFD7-906805487DA3:
;&P 粘贴文件夹结构(Shift:含子文件夹结构)
;粘贴所选文件夹结构，Shift包含子文件夹	;{
	global	My_SouDirs
	if My_SouDirs=        ;如果源文件源数据为空，则中止
		return
;}

;获取要粘贴的位置		;{
	My_DesDir:=CustomFunc_getCurrentDir()
	if My_DesDir=
	{
		MsgBox, 64, 提示, 请在【资源管理器】或【TC】中粘贴文件夹结构
		return
	}
;}

;检测SHIFT键，如果按下，则粘贴子文件夹		;{
	MyKeyStatus:=0
	if GetKeyState("Shift")
		MyKeyStatus:=1
;}

;创建文件夹结构	;{
	Loop,parse,My_SouDirs,`n,`r
	{
		if (A_LoopField="")
			continue
		if !InStr(FileExist(A_LoopField), "D")
			continue
		if(MyKeyStatus=0){
			SplitPath,A_LoopField,,,,MyOutNameNoExt
			FileCreateDir,%My_DesDir%\%MyOutNameNoExt%
		} else {
			TemDir:=A_LoopField
			Loop, Files, %TemDir%\*.*,RD		;R：子文件夹；D：目录，F：文件
			{
				StringReplace,NewDir,A_LoopFileFullPath,%TemDir%,%My_DesDir%,All
				FileCreateDir, %NewDir%
			}
		}
	}
	;清空数据
	My_SouDirs:=""
;}
Return
A1666266-7F67-4126-9BF8-17229DA7E3E7:
;&F  分辨率1080P
WinMove, A, , 70, 0, 1850, 1080
return
Return
A217E45B-4C5A-4698-BAF3-5FB911999CF6:
;IE Window Element Spy (&I)
Run "%A_AhkPath%" "\QuickZ\Apps\AutoHotkey\IE_Window_Element_Spy.ahk"
Return
A3BB4CC3-76A5-45C3-811B-B3D029030BD1:
;向右移动
Send {Right}
Return
A60D89D0-60E7-4380-8ED6-4D68B91C4B99:
;批渲染
MySel:=QZData("files")
Run,%A_ScriptDir%\Apps\Python\批处理_Ae渲染.py %MySel%
Return
Return
A95983DD-5E12-48DA-86CF-A12419E48473:
;&S  转换为AHK原义单行文本
QZSel:=CustomFunc_QZSel()
WinActivate % "ahk_class " QZSel.WinClass
WinWaitActive % "ahk_class " QZSel.WinClass
PreClipboard:=ClipboardAll
sleep 200
Clipboard:=CustomFunc_TextEscaping2SingleLine(QZSel.text)
Send ^v
Clipboard:=PreClipboard
return
Return
A9696DA0-8EFA-45B9-B04D-93F5F0117825:
;&P  复制完整路径
clipboard := QZData("Files")
Return
AB089158-AEBF-4083-84B7-AD6EBEEBE7D3:
;通用_粘贴（Ctrl+V）
sendinput,^v
Return
AC4FB832-37DF-4CA2-8AF7-76665A211345:
;通用_End
sendinput,{End}
Return
ADAF6CBA-7399-4318-9FAB-6E75299917EE:
;&P  Ping测试（列表标签）
List:=QZData("{box:list[www.163.com][114.114.114.114][www.baidu.com]}")
;msgbox % List

run cmd.exe /k ping %list% -t
Return
AE9893EB-1A7C-4C1D-882A-CE6393844BF6:
;&3  重命名 (输入内容)文件、文件夹名
InputBox, MyInsert, 提示,请输入要添加的内容
if (MyInsert="")
	return
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%MyInsert%%MyOutNameNoExt%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%MyInsert%%MyOutNameNoExt%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
B3F5810E-AD29-48A3-96B5-438D72A97E6D:
;通用_保存（Ctrl+S）
sendinput,^s
Return
B7D0588A-975B-4BBC-8B17-388108A03648:
;&N 截图
EnvGet, WorkFlow,WorkFlow
Process, Wait, Snipaste.exe, 1
NewPID := ErrorLevel  ; 由于 ErrorLevel 会经常发生改变, 所以要立即保存这个值.
if not NewPID
{
    Run,%WorkFlow%\Tools\Snipaste\Snipaste.exe
    Sleep, 200
     send,^+!{F2}
    return
}
if NewPID
{
    send,^+!{F2}
    return
    }
return
Return
B879362D-CC73-4A90-BD06-80C17D18DE67:
;&4  重命名 文件、文件夹名(输入内容)
InputBox, MyInsert, 提示,请输入要添加的内容
if (MyInsert="")
	return
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	if InStr(FileExist(MyTemFile), "D")
	{
		MyNewFile =%MyOutDir%\%MyOutNameNoExt%%MyInsert%
		FileMoveDir,%MyTemFile%,%MyNewFile%
	} else {
		MyNewFile =%MyOutDir%\%MyOutNameNoExt%%MyInsert%.%MyOutExt%
		FileMove,%MyTemFile%,%MyNewFile%
	}
}
Return
BA1BAE22-4073-4DB8-A1FB-14ED4014E514:
;&T  打开快捷方式所指目录(TotalCMD)
MySel:=QZData("files" )
TLAppPath:=QZData("%TOTALCMD%")
FileGetShortcut,%MySel%,MyTemFile
SplitPath,MyTemFile,,MyOutDir
Run,%TLAppPath% /T /R="%MyOutDir%"
Return
BC8B2C28-702C-452B-A4DD-44B72F0E29F8:
;通用_VIMD清除输入
QZ_VIMD_ClearInput()
Return
C24ACF1B-A551-44F1-A10A-978A11547342:
;&3  360文件粉碎机
ExePath=%APP%\360文件粉碎机独立版.exe
;指定程序路径
WinTitle=ahk_exe FileSmasher.exe
;打开程序后的默认标题
CustomFunc_RunD(ExePath,WinTitle,x=0,y=0,WaitDuration=0)
Return
Return
C3CBD9F1-D657-46C5-A5F5-9D546A871916:
;&R  普通正则式表达式转成Send形式
;给正则式中特殊的字符自动加上花括号，以便可用于Send等指令中，应用于SendRaw不方便的情况。
WinActivate % "ahk_class " QZData("winclass")
WinWaitActive % "ahk_class " QZData("winclass")
Send % TransRegEx(QZData("text"))
return

TransRegEx(RegExText) {
	Loop 2
	{
		RegExText := RegExReplace(RegExText, "{", "{{}")
		RegExText := RegExReplace(RegExText, "(?<=[^{{])\}", "{}}")
		Arr=^,!,+,#
		Loop, Parse, Arr, `,
			RegExText := RegExReplace(RegExText, "((?<=[^{])\" A_loopfield "(?=[^}]))|^\" A_loopfield "|\" A_loopfield "$", "{" A_loopfield "}")
	}
	return RegExText
}
Return
CA3792E4-8B82-4584-BECA-8DC70F6897E8:
;通用_定位文档开头（Ctrl+Home）
send,^{home}
Return
D37520E3-6601-4A1A-B9B7-A0FB17EA7298:
;&Z JPG压缩包生成PDF文件
;检查rar.exe是否在
rar:=QZData("%rar%")
if !FileExist(rar) {
	MsgBox, 0, , 请在QZ中定义变量【rar.exe】的路径
	return
}

;以下代码逐个处理压缩文件	
MySel:=gMenuZ.Data.files
Loop, Parse, MySel, `n, `r
{
	ToolTip,解压第%A_index%个压缩文件`n%A_LoopField%
	;解压到临时文件夹
	if A_LoopField=
		continue
	UnZipDir=%A_temp%\Kawvin_UnZip_%A_now%
	FileCreateDir,%UnZipDir%
	MyCmdline= `"%rar% `" x  `"%A_LoopField%`"  `"%UnZipDir%`"\
	runwait,%MyCmdline%,,hide
	;取得要压缩的文件列表
	FileList =
	Loop, Files, %UnZipDir%\*.jpg,R
		FileList = %FileList%%A_LoopFileFullPath%`n
	SplitPath,A_LoopField,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	NewPdfFile=%MyOutDir%\%MyOutNameNoExt%.pdf	;先假定 pdf 文件路径
	NewPdfFile:=CustomFunc_FileNameCheck(MyOutDir,MyOutNameNoExt,"pdf") ;检查文件名
	ToolTip,生成第%A_index%个PDF文件`n%NewPdfFile%
	MyFun_JPEG2PDF(NewPdfFile,FileList)
	ToolTip
	FileRemoveDir,%UnZipDir%, 1
}
MsgBox, 0, Title, 转换完成, 0.5
return

MyFun_JPEG2PDF(NewPdfFile,FileList){
	;检查jpeg2pdf.exe是否在
	jpeg2pdf:=QZData("%jpeg2pdf%")
	if !FileExist(jpeg2pdf) {
		MsgBox, 0, , 请在QZ中定义变量【jpeg2pdf】的路径
		return
	}
	MySel_FirstFile:=RegExReplace(FileList,"(.*)\r.*","$1")  ;取第一行
	FirstFileOutDir:=RegExReplace(MySel_FirstFile, "\\[^\\\r\n]+((\r\n.+)|$)") ;获取文件列表中第一个文件的父目录
	SplitPath,FirstFileOutDir,MyOutFileName
	WorkingDir:=FirstFileOutDir ;先假定工作目录为首个文件的父目录
	FromDifferentDir:=false ;先假定文件并非来自不同路径
	FileArray:={}
	Loop, Parse, FileList, `n, `r
	{
		FileArray.Push(A_LoopField)
		if FromDifferentDir
			continue
		SplitPath, A_LoopField, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
		if OutDir!=%FirstFileOutDir%
		{
			FromDifferentDir:=True
			FileRemoveDir, %A_Temp%\Jpeg2Pdf_Temp, 1
			FileCreateDir, %A_Temp%\Jpeg2Pdf_Temp
			WorkingDir=%A_Temp%\Jpeg2Pdf_Temp
		}
	}
	if FromDifferentDir	
	{
		FileListTemp=
		Loop, Parse, FileList, `n, `r
			FileCopy, %A_LoopField%, %A_Temp%\Jpeg2Pdf_Temp
		FileList=%A_Temp%\Jpeg2Pdf_Temp\*.jpg
	} 
	else 
		FileList :="""" RegExReplace(FileList, "\r\n", """ """) """"
	Command="%jpeg2pdf%" -r both -z fit -p auto -o "%NewPdfFile%" %FileList%
	RunWait, %Command%, %WorkingDir%,hide ;该程序必须指定工作目录为图片所在目录否则无法工作。
	;FileRemoveDir, %A_Temp%\Jpeg2Pdf_Temp, 1
	;MsgBox, 0, Title, 合并完成, 0.5
}
return
Return
D7CB8DE9-80BB-49D1-8B3D-2C45D3735416:
;&T IDM下载此链接
MySelText:=QZData("{text}")
#WinActivateForce
MyRunPath:=QZData("%IDM%")
run,%MyRunPath%
;sleep,2000
WinActivate,Internet Download Manager
WinWaitActive, Internet Download Manager
CoordWinClick(41, 82)
click
sleep 10
WinWaitActive, 输入新任务的地址, , 5
Clipboard:=MySelText
sendinput,^v
Return
DC0FA102-C21E-4540-AFF3-79FA148BCC39:
;&R  重启Explorer
Process, Close, explorer.exe 
Process,Exist,explorer.exe 
if ErrorLevel=0
	{
	MsgBox 哈哈，关闭了资源管理器
	sleep 500
	run explorer.exe 
	return
	}
else
	MsgBox 没有关闭
return
Return
DC42541B-F91E-40C3-9EC0-6E6CD1AD18AF:
;&Z 在其他浏览器打开
;获取当前浏览器
CurWinClass:=QZData("winclass") ;将获取的class名赋值给用户变量
Curhwnd:=QZData("hWnd")
WinActivate,Ahk_ID %Curhwnd%
sleep,100
if (CurWinClass="MozillaWindowClass") or (CurWinClass="QQBrowser_WidgetWin_1") ;如果当前激活窗口为资源管理器
{
	OldCP:=Clipboard
	sendinput,{F6}
	sleep,200
	sendinput,^c
	sleep,200
}
if (CurWinClass="MozillaWindowClass") {
	AppPath:=QZData("%qqbrowser%")
	run,%AppPath%
sleep,2000
	WinWaitActive,ahk_class QQBrowser_WidgetWin_1,,5
sendinput,{F6}
	sleep,200
	sendinput,^v
	sleep,200
	sendinput,{enter}
sleep,200
	Clipboard:=OldCP
return
}
if (CurWinClass="QQBrowser_WidgetWin_1") {
	AppPath:=QZData("%firefox%")
	run,%AppPath%
sleep,2000
	WinWaitActive,ahk_class MozillaWindowClass,,5
sendinput,^l
	sleep,1000
	sendinput,^v
	sleep,200
	sendinput,{enter}
sleep,200
	Clipboard:=OldCP
return
}
	
	

Return
E09EF4AF-7476-465B-AA1F-D127B0D8110F:
;&U  文件、文件夹移动到上级文件夹
MySel:=QZData("Files")
;msgbox % MySel
MyParentDir:=
MyGrandDir:=
loop,Parse,% MySel,`n,`r    ;循环读取每一行
{
	MyTemFile := trim(A_loopfield)
	if (A_index=1)
	{
		SplitPath,MyTemFile,,MyParentDir		;所选文件的父目录
		SplitPath,MyParentDir,,MyGrandDir		;父目录的上级目录
	}
	if InStr(FileExist(MyTemFile), "D")  ;区分是否文件夹,Attrib= D ,则是文件夹
	{
		SplitPath,MyTemFile,SourDir
		FileMoveDir, %MyTemFile%, %MyGrandDir%\%SourDir%
	} else {
		FileMove,%MyTemFile%,%MyGrandDir%
	}
}
Return
E1C5B66E-2B6B-4FE7-B878-B965D90E2F08:
;&N 内存清理
EnvGet, WorkFlow,WorkFlow
Process, Wait, memreduct.exe, 1
NewPID := ErrorLevel  ; 由于 ErrorLevel 会经常发生改变, 所以要立即保存这个值.
if not NewPID
{
	Run,%WorkFlow%\tools\TotalCMD\Tools\MemReduct\memreduct.exe
	Sleep, 200
	Send, ^{F1}
	return
}
if NewPID
{
	Send, ^{F1}
	return
}
return

Return
E7BC14C5-0AF4-4646-BDCC-B132DE593C0E:
;&Y  智能解压压缩
 GetFiles:=QZData("{file:path}")
 RunCmd=%A_ScriptDir%\Apps\Kawvin系列软件\Kawvin智能解压\Kawvin智能压缩解压.ahk   -a  "%GetFiles%" 
runwait,%RunCmd%
Return
E8604FE8-D060-4B57-B00A-376B8E385B1F:
;通用_另存为（Ctrl+Shift+S）
sendinput,^+s
Return
E9DB0A63-DF00-4351-BA27-CD824B3D6103:
;&1  压缩 以nconvert
Gui Destroy
Gui Add, GroupBox, x10 y0 w410 h43, 压缩比(快捷键：1-9)
Gui Add, Radio, x20 y15 w40 h23 vCae_Value gnconvert_Compress, &10
Gui Add, Radio, x65 y15 w40 h23 gnconvert_Compress, &20
Gui Add, Radio, x110 y15 w40 h23 gnconvert_Compress, &30
Gui Add, Radio, x155 y15 w40 h23 gnconvert_Compress, &40
Gui Add, Radio, x200 y15 w40 h23 gnconvert_Compress, &50
Gui Add, Radio, x245 y15 w40 h23 gnconvert_Compress, &60
Gui Add, Radio, x290 y15 w40 h23 gnconvert_Compress, &75
Gui Add, Radio, x335 y15 w40 h23 gnconvert_Compress, &80
Gui Add, Radio, x380 y15 w40 h23 gnconvert_Compress, &90
Gui Show, , caesiumclt压缩(By_Kawvin)
Return

nconvert_Compress:
gui,Submit
Cae_ValueArray:={1:10,2:20,3:30,4:40,5:50,6:60,7:75,8:80,9:80}
Cae_Value:=Cae_ValueArray[Cae_Value]
MySel:=QZData( "{file:path}"  )
nconvert:=QZData( "%nconvert%")
Loop, Parse, MySel, `n
{
    if A_LoopField =  ; 忽略列表末尾的最后一个换行符 (空项).
        continue
	SplitPath,A_LoopField,,MyPath
	Tooltip 当前第【%A_Index%】个文件`n%A_LoopField%
	MyCmdline=%nconvert% -overwrite -resize %Cae_Value%`% %Cae_Value%`% `"%A_LoopField%`"
	runwait,%ComSpec% /c "%MyCmdline%",,Hide
}
Tooltip
Return
EB149B24-9A2D-4567-B2BA-9F1622B61973:
;通用_确认（Enter）
sendinput,{Enter}
Return
EC648E88-1E87-4510-943B-30C555DB1435:
;&6  重命名 删除后缀
MySel:=QZData("files")
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	if InStr(FileExist(MyTemFile), "D")
		continue
	SplitPath,MyTemFile,MyOutFileName,MyOutDir,MyOutExt,MyOutNameNoExt,MyOutDrive
	MyNewFile =%MyOutDir%\%MyOutNameNoExt%
	FileMove,%MyTemFile%,%MyNewFile%
}
Return
ECFAAF8D-F24E-4FE9-B030-5BF4E358F155:
;&S  所选文本转到 SciTE4 中编辑
AppPath:=QZData("%scite%")
clipboard:=QZData("{Text}" )
ifnotexist,%AppPath%
	return
IfWinNotExist	ahk_class SciTEWindow	;如果SciTE4没有打开
{
	Run,%AppPath%,,Max
	WinWait,ahk_class SciTEWindow,,5
	if ErrorLevel		;如果5秒没激活，则退出
		return
	WinActivate
	sendinput,^v
}
IfWinNotActive ahk_class SciTEWindow
{
	Run,%AppPath%,,Max
	WinWait,ahk_class SciTEWindow,,5
	if ErrorLevel			;如果5秒没激活，则退出
		return
	WinActivate
	sendinput,^n
	sleep,300
	sendinput,^v
}
clipboard:=
Return
F1958409-2552-4B42-AD76-E3E5CE141AC4:
;&M  文件、文件夹移动到(...)
MySel:=QZData("files")
FileSelectFolder,MySelDir,*,3
if (MySelDir="")
	return
loop,Parse,MySel,`n     ;循环读取每一行
{
	MyTemFile := RegExReplace(A_loopfield,"(.*)\r.*","$1")
	SplitPath,MyTemFile, SourceFolderName ; 仅从它的完全路径提取文件夹名称。
	if InStr(FileExist(MyTemFile), "D")  ;区分是否文件夹,Attrib= D ,则是文件夹
		FileMoveDir, %MyTemFile%, %MySelDir%\%SourceFolderName%
	else 
		FileMove,%MyTemFile%,%MySelDir%
}
Return
F23A6DDF-0F9B-4F5D-A74B-F0E29565CB6D:
;&D  转到 Notepad++ 中编辑
Editor= ;执行前清空变量
Editor:=QZData("%NotepadJJ%") ;在本行指定要使用的编辑器变量
;===========
;以下内容无需改动
;===========
dPath=
dPath:=getDocumentPath()
WinActivate % "ahk_class" QZData("winclass")
WinWaitActive % "ahk_class" QZData("winclass")
dTitle=
WinGetTitle, dTitle,  A
;~ ;===========
;~ ;通过Pipe运行代码
;~ ;===========
ScriptContent:=% "SetTitleMatchMode, 3`nGroupAdd, GroupName, " dTitle "`nWinClose, ahk_group GroupName`nWinWaitClose, ahk_group GroupName`nRun, """ Editor """ """ dPath """`nreturn"
CustomFunc_PipeRun(ScriptContent)
Return
Return
F2556E4A-B657-4DF6-86F2-0CAF396A2A86:
;&A  添加QQ好友
clipboard := QZData("text")
;If ! (RegExMatch(Clipboard,"^[0-9]{5,11}$"))  ;限定qq的位数为5--11位
;return
;else
run tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=%Clipboard%  ;没有指定那个qq加好友
WinWait,添加好友 ahk_class TXGuiFoundation,,0.5
WinActivate  添加好友 ahk_class TXGuiFoundation
ControlClick,x222   y96,添加好友 ahk_class TXGuiFoundation             ;坐标为相对活动窗口所在的坐标，不会移动鼠标
return
Return
F27C1A31-1463-43AB-B8BF-F98A7AEDA300:
;标签测试（示例）
;文件标签
msgbox % QZData( "Files" )
msgbox % QZData( "FileExt" )
msgbox % QZData( "FileName" )
msgbox % QZData( "FileDir" )
msgbox % QZData( "FileMulti" )
msgbox % QZData( "{file:path}" )
;变量
msgbox % QZData( "%Photoshop%" )
;文本
msgbox % QZData( "{text}" )
msgbox % QZData( "{text:cp0}" )
msgbox % QZData( "{text:utf-8}" )
msgbox % QZData( "{select}" )
;日期时间
msgbox % QZData( "{date:yyyyMMdd}" )
msgbox % QZData( "{date:yyyy-MM-dd}" )
msgbox % QZData( "{date:yyyy.MM.dd}" )
msgbox % QZData( "{date:yyyyMMdd_HHmmss}" )
msgbox % QZData( "{date:yyyy年MM月dd日HH时mm分}" )
msgbox % QZData( "{date:yyyy年MM月dd日_HH时mm分ss秒}" )
;输入对话框
msgbox % QZData( "{input:1234}" )
msgbox % QZData( "{input:44444:hide}" )
;文件对话框
msgbox % QZData( "{box:filebrowser}" )
msgbox % QZData( "{box:folderbrowser}" )
;列表框
msgbox % QZData( "{box:list[www.163.com][114.114.114.114][www.baidu.com]}")

Return
F576D8D3-11DF-46D4-BE01-7B47BB7BFCC5:
;脚本
dirMenu1=%A_ScriptDir%\User\AfterEffect\Script
menu_fromfiles("filelist1", "脚本", "RunAeScript", dirMenu1, "*.jsx|*.jsxbin", "thismenu", 1)

RunAeScript:
    curpath := menu_itempath("filelist1", dirMenu1)
	WinActivate, ahk_exe AfterFX.exe
    ; WinActivate, ahk_exe %AeExePath%
    AeExePath := GetProcessPath()
    RunWait, %AeExePath% -s -r %curpath%,,Hide
    return
RETURN

GetProcessPath(){
	; DetectHiddenWindows,On
	; Process,Exist,%P%
	; if ErrorLevel>0
	; {
	; PID=%ErrorLevel%
	; WinGet,lujing,ProcessPath,ahk_pid %pid%
    ; msgbox %lujing%
	; return lujing
	; }
	; else
	; return "Sorry,找不到" %P% "!"
    WinGet, pPath, Processpath, A
    SplitPath,pPath,pName,pDir,,pNameNoExt
    if(pName="AfterFX.exe")
    {
        ; MsgBox %pPath%
        Return pPath
    }else{
        MsgBox "AE未运行，请先运行!"
    }
    return
 }
Return
F942F668-5EBB-4C1D-B7FC-B7B28999846F:
;测试用_全局热键
msgbox ,显示本消息说明，全局热键成功
Return
FA5B36FF-5132-4F62-A78C-5C824DF1C91A:
;反编译jsbin文件
MySel:=QZData("files")
MyselOut := StrReplace(MySel, .jsxbin, ".jsx")
Run,%A_ScriptDir%\Apps\jsxBinToJsx\jsxbin_to_jsx.exe %MySel% %MyselOut%
Return
Return
FFF8C639-F321-4CD1-9038-F45B3C173F97:
;&D 删除空目录
My_SouDirs:=QZData("files")
Run, %A_ScriptDir%\Apps\DELEMPTY.exe -d -s -y %My_SouDirs%
Return
Return
